<!DOCTYPE html>
<html>
{include file="public/header" /}
<body>
<style>
    .layui-form-label{
        width: 100px;
    }
    .layui-input{width: 500px;}

</style>
<div class="layui-fluid" id="app">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">

            <div class="layui-card" >
                <!--<div class="layui-card-header">云存储</div>-->
                <div class="layui-card-body">
                    <div class="layui-tab layui-tab-brief" lay-filter="component-tabs-brief">
                        <ul class="layui-tab-title">
                            <li class="layui-this">微信配置</li>
                        </ul>
                        <div class="layui-tab-content">
                            <div class="layui-tab-item layui-show">
                                <div class="layui-form" wid150="" lay-filter="">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">appid</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="appid" value="{$item.appid}" lay-verify="required" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">appsecret</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="appsecret" lay-verify="required" value="{$item.appsecret}" class="layui-input">
                                        </div>
                                    </div>

                                    <div class="layui-form-item">
                                        <label class="layui-form-label">公众平台通信</label>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">URL</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="URL" value="{$item.URL}" lay-verify="required" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">Token</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="Token" lay-verify="required" value="{$item.Token}" class="layui-input">
                                        </div>
                                    </div>

                                    <div class="layui-form-item layui-form-text">
                                        <label class="layui-form-label">配置参考</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="" value="1.安全中心-》IP白名单" readonly class="layui-input">
                                            <input type="text" name="" value="2.公众号设置-》功能设置【业务域名,JS接口安全域名,网页授权域名】" readonly class="layui-input">
                                        </div>
                                    </div>

                                    <div class="layui-form-item form-footer2">
                                        <div class="layui-input-block">
                                            <button class="layui-btn" lay-submit="" lay-filter="set_website">确认保存</button>
                                        </div>
                                    </div>
                                </div>

                            </div>

                        </div>
                    </div>
                </div>
            </div>


        </div>


    </div>
</div>

<script>


    layui.use(['form'], function () {
        var $ = layui.$
            , layer = layui.layer
            , form = layui.form;

        //网站设置
        form.on('submit(set_website)', function (obj) {
            //layer.msg(JSON.stringify(obj.field));
            $.post("{:url('wxconfig')}", obj.field, function (res) {
                if (res.code == 1) {
                    layer.msg(res.msg, {icon: 1})
                    return false;
                } else {
                    layer.msg(res.msg, {icon: 2}, function () {
                        location.reload();
                    })
                    return false;
                }

            });
            return false;
        });


    });

</script>
</body>
</html>




